Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle replication lag when authenticating with a Bearer Token #1922

Merged
merged 4 commits into from
Oct 9, 2020

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Oct 9, 2020

Changes / Features implemented

  • Add MasterReplicaOAuth2Validator class
  • Configure MasterReplicaOAuth2Validator as the OAuth2 Request validator
  • Retrieve UserProfile from main database on failure

Steps taken to verify this change does what is intended

  • Added tests

Side effects of implementing this change

  • On failure to retrieve the AccessToken from the read replica, the application will now try to retrieve the AccessToken from the master database.

Closes #1920

@DavisRayM DavisRayM changed the title [WIP] Handle replication lag when authenticating with a Bearer Token Handle replication lag when authenticating with a Bearer Token Oct 9, 2020
@DavisRayM DavisRayM force-pushed the 1920-bearer-token-replication-lag branch from 2e624ec to 4956a2a Compare October 9, 2020 09:57
@DavisRayM DavisRayM changed the title Handle replication lag when authenticating with a Bearer Token [WIP] Handle replication lag when authenticating with a Bearer Token Oct 9, 2020
@DavisRayM DavisRayM force-pushed the 1920-bearer-token-replication-lag branch 3 times, most recently from 804bfbb to bfa855f Compare October 9, 2020 13:00
Test that the MasterReplicaOAuth2Validator fetches from the Master
Database if it fails to retrieve the AccessToken from the Read Replica
@DavisRayM DavisRayM force-pushed the 1920-bearer-token-replication-lag branch from bfa855f to 8a22e4c Compare October 9, 2020 13:01
@DavisRayM DavisRayM changed the title [WIP] Handle replication lag when authenticating with a Bearer Token Handle replication lag when authenticating with a Bearer Token Oct 9, 2020
@DavisRayM DavisRayM force-pushed the 1920-bearer-token-replication-lag branch from 8a22e4c to 593ef72 Compare October 9, 2020 13:02
Copy link
Member

pld commented Oct 9, 2020

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- onadata/apps/api/viewsets/connect_viewset.py  1
         

See the complete overview on Codacy

@DavisRayM DavisRayM merged commit 9564ce1 into master Oct 9, 2020
@DavisRayM DavisRayM deleted the 1920-bearer-token-replication-lag branch October 9, 2020 14:05
@DavisRayM DavisRayM mentioned this pull request Oct 12, 2020
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User's credentials have not yet been synced to the read replica.
3 participants